<template>
<div class="loginContainer">
<!--  登录表单开始-->
  <div class="loginForm">
    <div class="loginTitle">
      <span>欢迎登录</span>
    </div>
    <el-form ref="form" :model="loginForm" label-width="60px" label-position="left">
      <el-form-item label="用户名">
        <el-input v-model="loginForm.userName"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="loginForm.password" type="password"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button style="width: 100%" type="primary" @click="toLogin">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
  <!--  登录表单结束-->
</div>
</template>

<script>
export default {
  name: "Login",
  data(){
    return{
      loginForm:{
        userName:"",
        password:""
      }
    }
  },
  methods:{
    toLogin(){
      this.$router.push("/dash")
    }
  }
}
</script>

<style scoped lang="less">
.loginContainer{
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .loginTitle{
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin: 20px 0;
  }
  .loginForm{
    padding: 40px;
    width: 360px;
    border: 1px solid #ccc;
    border-radius: 15px;
  }
}
</style>
